﻿            @{
        string tmplId = Guid.NewGuid().ToString();
        using (var template = Html.Incoding().ScriptTemplate<FakeModel>(tmplId))
        {
            using (var each = template.ForEach())
            {
                @(Html.When(JqueryBind.Click)
                      .Do()
                      .Direct()
                      .OnSuccess(dsl => dsl.Utilities.Window.Alert("Yes")
                                           .If(builder => builder.Is(() => each.For(r => r.Is) == true.ToString())))
                      .AsHtmlAttributes()
                      .ToButton(each.For(r=>r.Value)))
            }
        }
    }    
    @(Html.When(JqueryBind.InitIncoding)
          .Do()
          .Direct(IncodingResult.Success(new[]
                                             {
                                                     new FakeModel { Is = true, Value = "True" },
                                                     new FakeModel { Is = false, Value = "False" },
                                             }))
          .OnSuccess(dsl => dsl.Self().Core().Insert.WithTemplateById(tmplId).Html())
          .AsHtmlAttributes()
          .ToDiv())   